Carbon


GetCIcon

Header: Icons.h Carbon status: Supported

Gets a handle to a color icon of resource type 'cicn'.

CIconHandle GetCIcon (
    SInt16 iconID
);
iconID

The resource ID for an icon of resource type 'cicn'. In general, you should specify your icon resources as purgeable.

function result

A handle to the CIcon structure for the icon, or NULL if the function could not find the resource.

DISCUSSION

The function searches the current resource chain for the resource. If it finds the resource, it reads the resource, creates a color icon structure for the icon, and initializes the fields of the structure according to the information contained in the 'cicn' resource.

To draw an icon obtained from this function in a specified rectangle, you can use either the PlotCIcon function, or the PlotCIconHandle function. The latter function allows you to specify transforms and alignments.

When you are finished with a handle obtained from this function, use the DisposeCIcon function to release the memory occupied by the color icon structure.

SPECIAL CONSIDERATIONS

This function may move or purge memory blocks in the application heap. For that reason, your application should not call it at interrupt time.

VERSION NOTES

This function is available in both System 6 and System 7.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when InterfaceLib 7.1 or later is installed. Exported by CarbonLib 1.0 and later and by InterfaceLib 7.1 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/18/2000)